package com.kay.service.impl;

import com.kay.client.SendMailClient;
import com.kay.service.EmailService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description:
 * @Author: Kay
 * @CreateDate: 2021/9/30$ 18:39$
 * @UpdateUser: Kay
 * @UpdateDate: 2021/9/30$ 18:39$
 */
@Service
public class EmailServiceImpl implements EmailService {
    @Autowired
    private SendMailClient sendMailClient;

    @Override
    public boolean sendMail(String mailAdr, String content) {
        try {
            sendMailClient.sendMail(mailAdr, "注册验证码", content);
        } catch (javax.mail.MessagingException e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }
}
